import { useRef } from 'react'
function MyInput(props) {
    const inputRef = useRef(null)
    const handleClick = () => {
        inputRef.current.focus()
    }
    return <>
        <input ref={inputRef} type="text" />
        <button onClick={handleClick}>点我聚焦</button>
    </>
}

export default MyInput;